package com.api.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.api.dao.DomainMapper;
import com.api.entity.Domain;
import com.api.service.DomainService;

@Service
public class DomainServiceImpl implements DomainService{

	@Autowired
	private DomainMapper domainMapper;

	@Override
	public int add(Domain domain) {
		domain.preInsert();
		return this.domainMapper.insert(domain);
	}

	@Override
	public Domain getDomain(Domain domain) {
		return this.domainMapper.get(domain);
	}

	@Override
	public Domain getDomainById(String id) {
		return this.domainMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<Domain> getDomainList(String porjectId) {
		return this.domainMapper.getDomainList(porjectId);
	}

	@Override
	public int deleteById(String id) {
		return this.domainMapper.deleteByPrimaryKey(id);
	}
	

}
